Skip to content

Polish translation of the Scala tutorial #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 8, 2017
Merged

Conversation

adam-wyluda
Copy link
Contributor

This is a complete translation of the Scala tutorial into the Polish language.

@heathermiller
Copy link
Member

Whoa! Yes! Another translation!! 😄
Thank you so much!

By any chance, is there anyone you could suggest that would be able to review this translation?

Copy link

@Krever Krever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Polish community should be really grateful for this. I left small comments about particular wording or translations but nothing really big.

I didn't have time to read it twice, so I think at least one more reviewer should take part in it.

tutorial-previous: currying
---

Scala wspiera mechanizm _klas case_. Klasy case są zwykłymi klasami z dodatkowymi założeniami:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this translation of case class has previously appeared anywhere or has been discussed? I know it is very hard to translate such names, but klasa case doesn't sound very well. Sadly, I don't have any obviously better one. Klasy przypadków has been used here: http://www.scala-lang.org/docu/files/ScalaTutorial-pl_PL.pdf and I think it sound a little better, but still not perfect...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, klasy przypadków sounds more natural. I wasn't sure if I should translate terms that are unique for Scala, but if it was translated before then I guess we should use this term.


Scala wspiera mechanizm _klas case_. Klasy case są zwykłymi klasami z dodatkowymi założeniami:

* Domyślnie immutable
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have met pretty good translation of immutable to niemutowalny or (slightly worse in my opinion) niezmienny. Is there a reason to use english word for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

immutable or niezmienny seems to be commonly used on Polish forums, but niemutowalny sounds very nice, I think we can use that instead.

}
```

Klasa `Stack` modeluje zmienny stos z zawierający elementy dowolnego typu `T`. Parametr `T` narzuca ograniczenie dla metod takie, że tylko elementy typu `T` mogą zostać dodane do stosu. Podobnie metoda `top` może zwrócić tylko elementy danego typu.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant z in stos z zawierający

tutorial-previous: implicit-parameters
---

Konwersja implicit z typu `S` do `T` jest określona przez wartość implicit, która jest funkcją typu `S => T` lub przez metodę implicit odpowiadającą funkcji tego typu.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar case like with klasy case. Have you considered translating implicit? I think people tend to use niejawne for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this, but niejawne in Polish suggests something that is just opposite of explicit. This might work for implicit conversions, but for implicit parameters we should probably use domniemany since implicit here means more like something that is implied.

W poniższym przykładzie zdefiniujemy metodę `sum`, która oblicza sumę listy elementów wykorzystując operacje `add` i `unit` obiektu `Monoid`. Należy dodać, że wartości implicit nie mogą być zdefiniowane globalnie, tylko muszą być elementem pewnego modułu.

```tut
/** Ten przykład wykorzystuje strukturę z algebry abstrakcyjnej aby zilustrować działanie parametrów implicit. Półgrupa jest strukturą algebraiczną na zbiorze A z łączna (która spełnia warunek: add(x, add(y, z)) == add(add(x, y), z)) operacją nazwaną add, która łączy parę obiektów A by zwrócić inny A. */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

łączna instead of łączną

tutorial-previous: traits
---

W przeciwieństwie do języków które wspierają jedynie pojedyncze dziedziczenie, Scala posiada bardziej uogólniony mechanizm ponownego wykorzystania klas. Scala umożliwia na wykorzystanie _nowych elementów klasy_ (różnicy w stosunku do klasy bazowej) w definicji nowej klasy. Wyraża się to przy pomocy _kompozycji domieszek_.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other places we use cecha as translation of trait and here it's changed to domieszka. I think cecha is much better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domieszka is a Polish term for mixin (see Wikipedia page) which is something different than just trait.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, I haven't seen it before. Sorry :)

tutorial-previous: higher-order-functions
---

Scala pozwala na zagnieżdżanie definicji funkcji. Poniższy obiekt określa funkcję `filter`, która dla danej listy filtruje elementy większe bądź równe niż podany próg `threshold`:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filtruje elementy większe bądź równe niż podany próg

I think it should be filtruje elementy większe bądź równe podanemu progowi


## Companion ##

Duża część obiektów singleton nie istnieje samodzielnie, ale jest powiązana z klasą o tej samej nazwie. Obiekt singleton generowany dla klasy case jest tego przykładem. Kiedy tak się dzieje, obiekt singleton jest zwany *obiektem companion* (co oznacza, że jest _towarzyszem_ tej klasy).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can consider obiekt towrzyszący instead of obiekt companion as it sound a bit more natural, IMHO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though about obiekt towarzysz which sounded a bit awkward but I like obiekt towarzyszący, I think we can use this translation.

}
```

Bardzo powszechne jest użycie wzorca typeclass w połączeniu z [wartościami implicit](implicit-parameters.html), takich jak `ipord` powyżej, zdefiniowanych w obiekcie companion. Dzieje się tak, ponieważ elementy obiektu companion są włączone w procesie wyszukiwania domyślnych wartości implicit.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elementy obiektu companion są włączone w procesie wyszukiwania

Maybe uwzględniane instead of włączone ?

tutorial-previous: variances
---

W Scali [parametry typów](generic-classes.html) oraz [typy abstrakcyjne](abstract-types.html) mogą być warunkowane przez ograniczenia typów. Tego rodzaju ograniczenia pomagają określić konkretne wartości zmiennych typu oraz odkryć więcej informacji na temat elementów tych typów. _Ograniczenie górne typu_ `T <: A` zakładają, że zmienna `T` odwołuje się jest podtypem typu `A`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

że zmienna T odwołuje się jest podtypem typu A.

Redundant odwołuje się

@adam-wyluda
Copy link
Contributor Author

Thank you @Krever for your review. I've added your suggestions to the translation, it's definitely much better now!

@SethTisue
Copy link
Member

no other reviewer has appeared, so let's just merge. it can always be improved further again. thanks again!

@SethTisue SethTisue merged commit a018c28 into scala:master Feb 8, 2017
@adam-wyluda
Copy link
Contributor Author

For some reason there is no link to it in language list on the right side, but I can see that it's deployed now. Is there something else I should add to make it available? It worked fine when I was running it on my machine.

@SethTisue
Copy link
Member

hopefully fixed in dca716f once it finishes deploying. if not let me know

@SethTisue
Copy link
Member

fix is not live, because #680

tutorial-previous: inner-classes
---

W Scali, klasy są parametryzowane wartościami (parametry konstruktora) oraz typami (jeżeli klasa jest [generyczna](generic-classes.html)). Aby zachować regularność, zarówno typy jak i wartości są elementami klasy. Analogicznie mogą one być konkretne albo abstrakcyjne.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be , after Scali, tbh.

}
```

Cechy oraz [klasy](classes.html) z abstrakcyjnymi typami są często używane w połączeniu z anonimowymi klasami. Aby to zilustrować wykorzystamy program, w którym utworzymy bufor sekwencji ograniczony do listy liczb całkowitych:
Copy link
Contributor

@mpociecha mpociecha Feb 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider adding comma after zilustrować.


Typ zwracany przez metodę `newIntSeqBuf` nawiązuje do specjalizacji cechy `Buffer`, w której typ `U` jest równy `Int`. Podobnie w anonimowej klasie tworzonej w metodzie `newIntSeqBuf` określamy `T` jako `List[Int]`.

Warto zwrócić uwagę na to, że często jest możliwa zamiana abstrakcyjnych typów w parametry typów klas i odwrotnie. Poniższy przykład stosuje wyłącznie parametry typów:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without na to it would sound better,


Adnotację stosuje się do pierwszej definicji lub deklaracji która po niej następuje. Możliwe jest zastosowanie więcej niż jednej adnotacji przed definicją lub deklaracją. Kolejność według której są one określone nie ma istotnego znaczenia.

Znaczenie adnotacji jest zależne od implementacji. Na platformie Java, poniższe adnotacje domyślnie oznaczają:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be comma after Java.

public class MyClass extends HisClass ...
```

W tym przypadku, Scala daje taką samą możliwość:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without comma after przypadku.

SMS is: SMS(12345, Hello!)
```

Jednym z najważniejszych zastosowań klas przypadków (skąd też się wzięła ich nazwa), jest **dopasowanie wzorca**. Poniższy przykład pokazuje działanie funkcji, która zwraca różne komunikaty, w zależności od rodzaju powiadomienia:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without comma before jest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also I wouldn't insert it after komunikaty.


```

Programując w Scali, zachęca się abyś jak najszerzej używał klas przypadków do modelowania danych, jako że kod który je wykorzystuje jest bardziej ekspresywny i łatwiejszy do utrzymania:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wykorzystujący je kod or kod, który je wykorzystuje, jest bardziej

Programując w Scali, zachęca się abyś jak najszerzej używał klas przypadków do modelowania danych, jako że kod który je wykorzystuje jest bardziej ekspresywny i łatwiejszy do utrzymania:

* Obiekty niemutowalne uwalniają cię od potrzeby śledzenia zmian stanu
* Porównanie przez wartość pozwala na porównywanie instancji tak jakby były prymitywnymi wartościami
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's needed a comma somewhere. Likely before jakby.

}
```

Program definiuje wykonywalną aplikację w postaci [obiektu singleton](singleton-objects.html) z główną metodą `main`. Metoda `main` tworzy nową instancję typu `Point` i zapisuje ją do wartości `pt`. Istotną rzeczą jest to, że wartości zdefiniowane z użyciem słowa kluczowego `val` różnią się od zmiennych określonych przez `var` (jak w klasie `Point` powyżej), tym że nie dopuszczają aktualizacji ich wartości.
Copy link
Contributor

@mpociecha mpociecha Feb 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma should be before że, not before tym.

tutorial-previous: regular-expression-patterns
---

W Scali, wzorce mogą być zdefiniowane niezależnie od klas przypadków. Obiekt posiadający metodę `unapply` może funkcjonować jako tak zwany ekstraktor. Jest to szczególna metoda, która pozwala na odwrócenie zastosowania obiektu dla pewnych danych. Jego celem jest ekstrakcja danych, z których został on utworzony. Dla przykładu, poniższy kod definiuje ekstraktor dla [obiektu](singleton-objects.html) `Twice`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without comma after Scali.

@mpociecha
Copy link
Contributor

mpociecha commented Feb 10, 2017

I know I'm late to the party (too late). But I quickly and briefly looked through the part of translated files. You can take this into account in case of some follow-up PR, if you want. :)

And, personally, to me it's a bit strange to read technical stuff in Polish. ;) Esp. that it's anyway Polish - English - PolGlish mix (it has to be like that). :)

But there was quite a lot of things to translate so really good job!

Edit: I can take a look at the rest of files but not now. And I'm looking rather at the wording and the punctuation than at the general context.

@mpociecha
Copy link
Contributor

Seth, it's hard to expect that reviewers will appear without the explicit invitation in case of (no offense :) ) such a niche repo as scala.github.com. ;)

@SethTisue
Copy link
Member

iirc, I did ask for reviewers on Gitter.

Is there some other way we should have publicized it? I don't think it quite rises to the level where it makes sense for scala_lang to tweet about it.

in general, on translations, it's usually the submitter who has the best chance of bringing in reviewers themselves, since they know people in their own language community.

@mpociecha
Copy link
Contributor

mpociecha commented Feb 11, 2017

  1. "I did ask for reviewers on Gitter." I didn't know. And it is what I meant by the invitation.
  2. Yes, I agree.

@SethTisue
Copy link
Member

in general, I think all of us — but especially the Scala team — could do more to alert the community to PRs that need a little love. I do it maybe once a week on Gitter, but I could probably be doing more like once a day. I'll try to keep it in mind.

I sometimes wonder if there ought to be a more regular and/or formal channel for this. maybe a weekly “help wanted” post to contributors.scala-lang.org, something like that. idk

@som-snytt
Copy link
Contributor

Maybe ask on gitter.PL. But gitter is ephemeral. I can't follow convos beyond a brief exchange. I wanted to keep up with gitter channels in 2017, but whenever I check, they're all maxed out at 100 messages of history. I like the idea of an automated reminder, of the sort that have always been sent to mailing lists, once a week, to the gitter channel, of moribund PRs, i.e., those which have been unloved for the entire week.

The bot could also single out a random user to ask, Hey, @ Jo, would you be interested in helping with a PR? That would be so embarrassing and so great.

@adam-wyluda
Copy link
Contributor Author

adam-wyluda commented Feb 11, 2017

@mpociecha Thanks for having a look at this, I'm really poor at punctuation :). I'll apply your suggestions soon in another PR (maybe along with translation of the new Basics page).

@mpociecha
Copy link
Contributor

@adamwy In meantime I'll finish reading this one since I was somewhere in the middle, I think. :)

In case of Basics or other future translations you can ping me. It may be definitely more effective if I'll create PRs against your branches with suggested fixes to punctuation instead of forcing you to apply each of them manually. ;)

@mpociecha
Copy link
Contributor

mpociecha commented Feb 11, 2017

@adamwy Honestly, finally I realised (better late than never ;) ) that it doesn't make sense to add comments to the already merged PR. I'll just create PR with my suggestions and will "add" you as a reviewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants